<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1{
            width: 300px;
            height: 300px;
            border: 1px solid #ddd;
            background-color: rgb(red, green, blue);
            background-image: url('../image/icon.jpg');
              /* 平铺 x-水平 y-垂直 */
            background-repeat: repeat-y;
            background-size: 100px 100px;
        }
        .div2{
            width: 112px;
            height: 180px;
            border: 1px solid #aaa;
            background-image: url('../image/icon.jpg');
            background-repeat: no-repeat;
            /* 
            X:正数---图片往右边移动
             :负数---图片往左边移动
            y:正数---图片往下边移动
             :负数---图片往上边移动  

             */
            background-position: 10px 0;
        }
    </style>
</head>
<body>
    <!-- 
        background-repeat 背景平铺
  background-size  背景尺寸
  background-position 背景定位
     -->
     <div class="div1"></div>
     <div class="div2"></div>
</body>
</html>